<?php 
require_once '../Lib/main.php';
$categoryDAO = new Dao_CategoryDAO();
$listCategory = $categoryDAO->getAllCategory();

?>


<a href="#">Tạo mới</a> - <a href="#">Xóa</a>

<table class="table-list" border="1">
		<tr class="header-list-title">
			<td width="5%">
				<input type="checkbox" value="1"/>
			</td>
			<td width="10%" class="checkbox-col">
				Id
			</td>
			<td width="30%">
				Tên
			</td>
			<td width="15%">
				Thứ tự hiển thị
			</td>
			<td width="20%">
				Trạng thái
			</td>
			<td width="10%">
				Chỉnh sửa
			</td>
		</tr>
		
		<?php 
		/* @var $category Model_Category */
		foreach ($listCategory as $key => $category): 
		?>
		<tr class="tr-data">
			<td class="checkbox-col">
				<input type="checkbox" value="<?php echo $category->getId();?>"/>
			</td>
			<td>
				<?php echo $category->getId();?>
			</td>
			<td>
				<?php echo $category->getName();?>
			</td>
			<td>
				<?php echo $category->getOrderIndex();?>
			</td>
			<td>
				<?php echo $category->getEnable();?>
			</td>
			<td>
			<?php $urlEdit = getUrlAdmin('editcategory.php', 'id=' . $category->getId());?>
				<a href="<?php echo $urlEdit; ?>"> chỉnh sửa</a>
			</td>
		</tr>
		<?php 
			endforeach; 
		?>
		
</table>
<p>
	<a href="#"> 1 </a> - <a href="#"> 2 </a> - <a href="#"> 3 </a>	
</p>
		
